import { Body, Controller, Post } from '@nestjs/common'
import { BorrowService } from './borrow.service'

@Controller('borrow')
export class BorrowController {
  constructor(private readonly borrowService: BorrowService) { }
  @Post('add')
  add(@Body() body) {
    return this.borrowService.add(body)
  }

  @Post('del')
  del(@Body() body) {
    return this.borrowService.del(body.id as number)
  }

  @Post('edit')
  edit(@Body() body) {
    return this.borrowService.update(body)
  }

  @Post('page')
  page(@Body() body) {
    return this.borrowService.getPageList(body)
  }

  @Post('getReceiveDetail')
  getReceiveDetail(@Body() body) {
    return this.borrowService.getReceiveDetail(body.receiveCode)
  }
}
